package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.CommunityInteractionMapper;
import com.ruoyi.system.domain.CommunityInteraction;
import com.ruoyi.system.service.ICommunityInteractionService;

/**
 * 社区互动Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-01-03
 */
@Service
public class CommunityInteractionServiceImpl implements ICommunityInteractionService 
{
    @Autowired
    private CommunityInteractionMapper communityInteractionMapper;

    /**
     * 查询社区互动
     * 
     * @param interactionId 社区互动主键
     * @return 社区互动
     */
    @Override
    public CommunityInteraction selectCommunityInteractionByInteractionId(Long interactionId)
    {
        return communityInteractionMapper.selectCommunityInteractionByInteractionId(interactionId);
    }

    /**
     * 查询社区互动列表
     * 
     * @param communityInteraction 社区互动
     * @return 社区互动
     */
    @Override
    public List<CommunityInteraction> selectCommunityInteractionList(CommunityInteraction communityInteraction)
    {
        return communityInteractionMapper.selectCommunityInteractionList(communityInteraction);
    }

    /**
     * 新增社区互动
     * 
     * @param communityInteraction 社区互动
     * @return 结果
     */
    @Override
    public int insertCommunityInteraction(CommunityInteraction communityInteraction)
    {
        communityInteraction.setCreateTime(DateUtils.getNowDate());
        return communityInteractionMapper.insertCommunityInteraction(communityInteraction);
    }

    /**
     * 修改社区互动
     * 
     * @param communityInteraction 社区互动
     * @return 结果
     */
    @Override
    public int updateCommunityInteraction(CommunityInteraction communityInteraction)
    {
        communityInteraction.setUpdateTime(DateUtils.getNowDate());
        return communityInteractionMapper.updateCommunityInteraction(communityInteraction);
    }

    /**
     * 批量删除社区互动
     * 
     * @param interactionIds 需要删除的社区互动主键
     * @return 结果
     */
    @Override
    public int deleteCommunityInteractionByInteractionIds(Long[] interactionIds)
    {
        return communityInteractionMapper.deleteCommunityInteractionByInteractionIds(interactionIds);
    }

    /**
     * 删除社区互动信息
     * 
     * @param interactionId 社区互动主键
     * @return 结果
     */
    @Override
    public int deleteCommunityInteractionByInteractionId(Long interactionId)
    {
        return communityInteractionMapper.deleteCommunityInteractionByInteractionId(interactionId);
    }
}
